package cn.edu.nchu.fragmentdemo.entity;

import cn.edu.nchu.fragmentdemo.bean.MarkerEntity;
import cn.edu.nchu.fragmentdemo.myComponents.components.MyPolylineClass;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.overlay.Overlay;

import java.io.Serializable;

/**
 * @author Wendy
 * @time 2019/12/29
 * @Email ${EMAIL}
 */
public class MyMarkerEntity extends MyBasicEntity implements Serializable {
    private Overlay overlay;
    private String id;
    private String tag;
    private GeoPoint geo;
    private int iconSet;
    private int iconGroup;
    private int icon;
    private String popMenuType;
    private boolean lock;
    private String whichRouteUK = "";
    private MyPolylineClass toObjectLine;

    private MarkerEntity markerEntity;

    public MyMarkerEntity() {
        markerEntity = new MarkerEntity();
    }

    public MarkerEntity getEntity() {
        return markerEntity;
    }

    @Override
    public String getPopMenuType() {
        return this.popMenuType;
    }

    @Override
    public void setPopMenuType(String popMenuType) {
        this.popMenuType = popMenuType;
        this.markerEntity.setPopType(popMenuType);
    }

    public void setIcon(int icon) {
        this.icon = icon;
        this.markerEntity.setIconTag(icon);
    }


    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getTag() {
        return tag;
    }

    @Override
    public void setDbTag(String dbTag) {
        super.setDbTag(tag);
    }

    @Override
    public String getDbTag() {
        return super.getDbTag();
    }

    public void setEntity(MarkerEntity markerEntity) {
        this.markerEntity = markerEntity;
    }

    public GeoPoint getGeo() {
        return geo;
    }

    public void setGeo(GeoPoint geo) {
        this.geo = geo;
    }

    public double getLatitude() {
        return markerEntity.getLatitude();
    }

    public void setLatitude(double latitude) {
        this.markerEntity.setLatitude(latitude);
    }

    public double getLongitude() {
        return markerEntity.getLongitude();
    }

    public void setLongitude(double longitude) {
        this.markerEntity.setLongitude(longitude);
    }

    public double getAltitude() {
        return markerEntity.getHeight();
    }

    public void setAltitude(double altitude) {
        this.markerEntity.setHeight(altitude);
    }

    @Override
    public void setId(String id) {
        this.id = id;
        this.markerEntity.setUk(id);
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public Overlay getOverlay() {
        return overlay;
    }

    @Override
    public void setOverlay(Overlay overlay) {
        this.overlay = overlay;
    }

    public void setIconInfo(int iconSet, int iconGroup, int icon) {
        this.iconSet = iconSet;
        this.markerEntity.setIconSet(iconSet);
        this.iconGroup = iconGroup;
        this.markerEntity.setIconGroup(iconGroup);
        this.icon = icon;
        this.markerEntity.setIconTag(icon);
    }

    public int getIconSet() {
        return iconSet;
    }

    public int getIconGroup() {
        return iconGroup;
    }

    public int getIcon() {
        return icon;
    }

    public boolean getLock() {
        return lock;
    }

    public void setLock(boolean lock) {
        this.lock = lock;
    }

    public String getWhichRouteUK() {
        return whichRouteUK;
    }

    public void setWhichRouteUK(String whichRouteUK) {
        this.whichRouteUK = whichRouteUK;
    }

    public MyPolylineClass getToObjectLine() {
        return toObjectLine;
    }

    public void setToObjectLine(MyPolylineClass toObjectLine) {
        this.toObjectLine = toObjectLine;
    }
}
